package com.alibaba.citrus.cr.sales.plan.dto.api.request;

import com.alibaba.citrus.cr.sales.plan.CustomLockKey;
import lombok.Data;

import java.util.Optional;

/**
 * @author lihuidong
 */
@Data
public class EditSalesPlanPublishRequest implements CustomLockKey {

    /**
     * 明细ID
     */
    private Long id;

    /**
     *  任务量
     */
    private Integer taskCount;

    /**
     * 上旬任务量
     */
    private Integer monthFirstTaskCount;

    /**
     * 中旬任务量
     */
    private Integer monthMiddleTaskCount;

    /**
     * 下旬任务量
     */
    private Integer monthLastTaskCount;

    @Override
    public String getCustomLockCondition() {
        return Optional.ofNullable(id).map(String::valueOf).orElse(null);
    }
}
